# coding : utf-8
__author__ = 'Miller'
__date__ = '2017/3/20 13:46 '
import xadmin
from .models import City, CourseOrg, Teacher


# Create your models here.
class CityAdmin(object):
    search_fields = ['name', 'desc', 'add_time']
    list_filter = ['name', 'desc', 'add_time']
    list_display = ['name', 'desc', 'add_time']


class CourseOrgAdmin(object):
    search_fields = ['name', 'desc', 'fav_nums', 'image', 'click_nums', 'adress', 'add_time', 'city']
    list_filter = ['name', 'desc', 'fav_nums', 'image', 'click_nums', 'adress', 'add_time', 'city']
    list_display = ['name', 'desc', 'fav_nums', 'image', 'click_nums', 'adress', 'add_time', 'city']


class TeacherAdmin(object):
    search_fields = ['name', 'org', 'work_year', 'work_company', 'work_position', 'points', 'add_time', 'fav_nums',
                     'click_nums']
    list_filter = ['name', 'org__name', 'work_year', 'work_company', 'work_position', 'points', 'add_time', 'fav_nums',
                     'click_nums']
    list_display = ['name', 'org', 'work_year', 'work_company', 'work_position', 'points', 'add_time', 'fav_nums',
                     'click_nums']

xadmin.site.register(City, CityAdmin)
xadmin.site.register(CourseOrg, CourseOrgAdmin)
xadmin.site.register(Teacher, TeacherAdmin)
